<template>
	<view 
	v-if="loading"
	class="box"
	:style="{
		background: maskBg
	}">
		<view class="box_inner">
			<view class="box_inner_one box_inner_item"
			:style="{
				background: color
			}"></view>
			<view class="box_inner_two box_inner_item"
			:style="{
				background: color
			}"></view>
			<view class="box_inner_three box_inner_item"
			:style="{
				background: color
			}"></view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			loading: {
				type: Boolean,
				default: true
			},
			maskBg: {
				type: String,
				default: '#ffffff'
			},
			color: {
				type: String,
				default: '#F34B48'
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		position: fixed;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 10;
		background-color: #ffffff;
		display: flex;
		justify-content: center;
		align-items: center;
		&_inner {
			display: flex;
			align-items: center;
			&_item {
				width: 40rpx;
				height: 40rpx;
				background-color: #f66f6a;
				border-radius: 50%;
			}
			&_one {
				animation: bouncedelay 1.4s infinite ease-in-out;
				animation-fill-mode: both;
				animation-delay: -.32s;
			}
			&_two {
				animation: bouncedelay 1.4s infinite ease-in-out;
				animation-fill-mode: both;
				animation-delay: -.16s;
			}
			&_three {
				animation: bouncedelay 1.4s infinite ease-in-out;
				animation-fill-mode: both;
			}
		}
	}
	@keyframes bouncedelay {
		0%,100%,80% {
			transform: scale(0);
		}
		40% {
			transform: scale(1);
		}
	}
</style>